<template>
  <div>
    <div v-html="content"
         v-if="content"></div>
    <div v-else
         style="text-align: center;padding:100px 0;">暂无数据</div>
  </div>
</template>

<script>
import $ from '../../../utils/jquery-1.11.3.min.js'
window.$ = $;
window.jQuery = $;
require('../../../utils/jquery-jumpto.js')
import { kb } from "@/api/systemport.js";
export default {
  data () {
    return {
      piid: "",
      type: "",
      content: ""
    }
  },
  mounted () {
    this.id = this.$route.query.id;
    this.type = this.$route.query.type;
    this.getDatil()
  },
  methods: {
    async getDatil () {
      var res;
      if (this.type == "drug") {
        res = await this.$kb.Draglnstmction({
          piid: this.id
        });
      } else if (this.type == "education") {
        res = await this.$kb.PharEduHtml({
          peid: this.id
        });
      } else if (this.type == "chineserecip") {
        res = await this.$kb.HerbalMedicineContent({
          chmid: this.id
        });
      } else if (this.type == "chinesemedi") {
        res = await this.$kb.TXYFaContent({
          cdid: this.id
        });
      } else if (this.type == "guide") {
        res = await this.$kb.Cguidelines({
          cgid: this.id,
        })
      }
      if (res.code == 200) {
        let http = process.env.VUE_APP_BASE_API + ":" + kb + "/Content";
        res.data = (res.data).replace(RegExp("../../Content", "g"), http)
        this.content = res.data;
        setTimeout(function () {
          $(".page_container").jumpto({
            firstLevel: "> h2",
            secondLevel: "> h3"
          });
        }, 1000)

      }
    }
  }
}
</script>

<style>
.jumpto-cotainer {
  position: relative;
}

.jumpto-subnav {
  position: absolute;
  top: 0;
  left: -120px;
  width: 100px;
  background: rgba(0, 0, 0, 0.7);
}

.jumpto-subnav .jumpto-second {
  display: none;
}

.jumpto-subnav.fixed {
  position: fixed !important;
  left: auto;
  top: 25px;
  margin-left: -120px;
}

.jumpto-subnav.fixed.bottom {
  top: auto;
  bottom: 0;
  position: absolute !important;
}

.jumpto-subnav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.jumpto-subnav ul li {
  list-style: none;
  padding: 0;
  margin: 0;
}

.jumpto-subnav ul li a {
  padding: 10px;
  display: block;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  color: white;
  font-size: 12px;
}

.jumpto-subnav ul li a:hover,
.jumpto-subnav ul li a.active {
  background: black;
}

.jumpto-subnav ul > li > ul > li > a {
  padding-left: 15px;
}

.jumpto-title,
.jumpto-close a {
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  display: block;
}

html {
  height: 100%;
}

body {
  background: #ffffff;
  padding: 0;
  text-align: center;
  font-family: 'open sans';
  position: relative;
  margin: 0;
  height: 100%;
}

.wrapper {
  height: auto !important;
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
}

a {
  text-decoration: none;
}

h1,
h2 {
  width: 100%;
  float: left;
}

h1 {
  margin-top: 100px;
  color: #6d461d;
  margin-bottom: 5px;
  font-size: 70px;
  letter-spacing: -4px;
}

h2 {
  color: #444;
  font-weight: 100;
  margin-top: 0;
  margin-bottom: 10px;
}

.pointer {
  color: #9b59b6;
  font-family: 'Pacifico', cursive;
  font-size: 30px;
  margin-top: 15px;
}

pre {
  margin: 80px auto;
}

pre code {
  padding: 35px;
  border-radius: 5px;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.1);
  border: rgba(0, 0, 0, 0.05) 5px solid;
  max-width: 500px;
}

.main {
  float: left;
  width: 100%;
  margin: 0 auto;
}

.main h1 {
  padding: 20px 50px;
  float: left;
  width: 100%;
  font-size: 90px;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  font-weight: 100;
  color: black;
  margin: 0;
  margin-top: 70px;
  font-family: 'Playfair Display';
  letter-spacing: -1px;
}

.main h1.demo1 {
  background: #1abc9c;
}

.reload.bell {
  font-size: 12px;
  padding: 20px;
  width: 45px;
  text-align: center;
  height: 47px;
  border-radius: 50px;
  -webkit-border-radius: 50px;
  -moz-border-radius: 50px;
}

.reload.bell #notification {
  font-size: 25px;
  line-height: 140%;
}

.reload,
.btn {
  display: inline-block;
  border: 4px solid #a2261e;
  border-radius: 5px;
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  background: #cc3126;
  display: inline-block;
  line-height: 100%;
  padding: 0.7em;
  text-decoration: none;
  color: #fff;
  width: 100px;
  line-height: 140%;
  font-size: 17px;
  font-family: open sans;
  font-weight: bold;
}

.reload:hover {
  background: #a2261e;
}

.btn {
  width: 200px;
  color: #fff;
  border: none;
  margin-left: 10px;
  background: #000;
}

.clear {
  width: auto;
}

.btn:hover,
.btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.btns {
  width: 410px;
  margin: 50px auto;
}

.credit {
  opacity: 0.5;
  text-align: center;
  color: #bbb;
  padding: 10px;
  margin: 0 0 40px 0;
  float: left;
  width: 100%;
}

.credit a {
  color: #ccc;
  text-decoration: none;
  font-weight: bold;
}

.back {
  position: absolute;
  top: 0;
  left: 0;
  text-align: center;
  display: block;
  padding: 7px;
  width: 100%;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  background: rgba(0, 0, 0, 0.65);
  font-weight: bold;
  font-size: 13px;
  color: #fff;
  -webkit-transition: all 200ms ease-out;
  -moz-transition: all 200ms ease-out;
  -o-transition: all 200ms ease-out;
  transition: all 200ms ease-out;
}

.back:hover {
  background: rgba(0, 0, 0, 0.85);
}

.page_container,
.other {
  max-width: 800px;
  margin: 50px auto;
}

.page_container h2,
.page_container h1,
.other h2,
.other h1 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  padding-bottom: 15px;
}

.page_container h2,
.page_container h3,
.other h3,
.other h2 {
  text-align: left;
}

.page_container h2,
.page_container h1,
.page_container h3,
.other h2,
.other h1,
.other h3 {
  color: black;
}

.page_container p,
.other p {
  color: black;
  font-size: 18px;
  line-height: 180%;
  text-align: left;
}

.page_container h2 {
  font-size: 18px;
}

.header {
  /* background: url(binding_dark.png) repeat; */
  color: white;
  overflow: hidden;
}

.header h1,
.header h2 {
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.1);
  color: #000;
}

.header h2 {
  font-weight: bold;
  font-size: 20px;
  text-transform: uppercase;
}

.other h1 {
  font-size: 46px;
  margin-bottom: 20px;
}

.pe_box_row {
  display: block;
}

.pe_box {
  display: inline-block;
  width: 400px;
  margin-right: 10px;
  vertical-align: top;
}

.pe_box .image {
  width: 150px;
  display: block;
  float: left;
  vertical-align: middle;
}

.pe_box .image img {
  display: block;
  margin: 0 auto;
}

.pe_box .text {
  float: right;
  width: 250px;
}

.pe_box .title {
  color: #15629f;
  /* background-image: url('../../resources/images_pe/mcdex_with_icons_arrow.gif'); */
  background-position: left center;
  background-repeat: no-repeat;
}

.pe_box .title h3 {
  font-size: 14px;
  font-weight: normal;
  padding: 0;
  margin: 0;
  margin-left: 20px;
  padding: 3px 10px;
  text-align: center;
  background-color: #fff;
  border: solid 1px #15629f;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}

.pe_box .content {
  padding: 0;
  margin-top: 5px;
  margin-left: 10px;
  margin-right: 10px;
  line-height: 160%;
  text-indent: 2em;
}

.pe_box_img {
  display: inline-block;
  width: 150px;
  height: auto;
  vertical-align: top;
}

.pe_box_img img {
  width: 160px;
  height: 160px;
  display: block;
}

.pe_box_img .content {
  text-align: center;
  font-size: 14px;
  line-height: 1.4em;
}

.pe_box_warning {
  display: inline-block;
  margin: 10px 0;
  height: auto;
  width: 100%;
}

.pe_box_row_warning .title {
  display: block;
  vertical-align: top;
}

.pe_box_warning .content {
  display: block;
  float: left;
  width: 40%;
  height: auto;
  min-height: 50px;
}

.pe_box_warning .images {
  display: block;
  float: left;
  width: 30%;
  margin: 10px 10px 0 10px;
  padding: 15px;
  line-height: 150%;
  font-size: 16px;
  background-color: #fff;
  border: solid 5px #fff57f;
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  border-radius: 15px;
  /* background-image: url('../../resources/images_pe/pe_warning_disease_note.gif'); */
  background-position: center;
  background-repeat: no-repeat;
  background-size: 80px 80px;
}

.pe_box_warning2 {
  display: inline-block;
  margin: 10px 0;
  width: 100%;
}

.pe_box_row_warning2 .title {
  display: block;
  vertical-align: top;
}

.pe_box_warning2 .content {
  display: block;
  float: left;
  width: auto;
  min-width: 20%;
  margin: 10px 10px 0 10px;
  padding: 15px;
  line-height: 150%;
  background-color: #fff;
  border: solid 5px #fff57f;
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  border-radius: 15px;
  /* background-image: url('../../resources/images_pe/pe_warning_disease_note.png'); */
  background-position: center;
  background-repeat: no-repeat;
  background-size: 80px 80px;
}

.pe_page_title div {
  display: block;
  height: 80px;
  margin: 0;
  margin-right: 130px;
}

.pe_page_title i {
  display: block;
  float: right;
  height: 80px;
  width: 125px;
  margin: 0;
  background-color: #fff;
  /* background-image: url('../../resources/images_pe/mcdex_logo.png'); */
  background-position: right center;
  background-repeat: no-repeat;
}

.pe_page_title h1 {
  display: block;
  float: left;
  margin: 0;
  height: 80px;
  max-width: 100%;
  font-weight: normal;
  font-style: normal;
  background-color: #fff;
  /* background-image: url('../../resources/images_pe/pe_page_title_line.gif'); */
  background-position: 0 42px;
  background-repeat: repeat-x;
}

.pe_page_title h1 b {
  display: block;
  height: 50px;
  line-height: 60px;
  color: #15629f;
  font-size: 40px;
  font-weight: normal;
  margin: 0;
  padding-left: 5px;
  overflow: hidden;
  white-space: nowrap;
  word-break: keep-all;
  text-overflow: ellipsis;
}

.pe_page_title h1 span {
  display: inline-block;
  float: right;
  height: 30px;
  line-height: 30px;
  color: #15629f;
  font-size: 20px;
  font-weight: normal;
  background-color: #fff;
  text-align: right;
  margin: 0;
  padding: 0;
}

.pe_page_block {
  display: block;
  margin: 20px;
  padding: 10px 0;
  border-top: dashed 1px #999;
}

.pe_page_block_20 {
  border-top: 0;
}

.pe_page_block ul {
  padding-left: 20px;
}

.pe_page_block ol {
  list-style: decimal;
  font-size: 14px;
  padding-left: 20px;
}

.pe_page_title {
  display: block;
  height: 80px;
  margin: 20px;
  background-color: #fff;
  /* background-image: url('../../resources/images_pe/pe_page_title_line.png'); */
  background-position: center;
  background-repeat: repeat-x;
}

.pe_notice_msg {
  display: block;
  height: 30px;
  margin: 0;
  margin-bottom: 10px;
}

.pe_notice_msg span {
  display: block;
  float: right;
  height: 30px;
  line-height: 30px;
  padding-left: 40px;
  color: #0d7149;
  text-align: left;
  /* background-image: url('../../resources/images_pe/pe_warning_disease_zhu.gif'); */
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 20px;
}

.pe_page_block h1 {
  color: #15629f;
  font-size: 16px;
  font-weight: normal;
  padding-left: 20px;
  /* background-image: url('../../resources/images_pe/pe_block_title_icons.gif'); */
  background-position: left center;
  background-repeat: no-repeat;
}

.pe_page_block.block_with_images_woman {
  /* background-image: url('../../resources/images_pe/pe_warning_woman.png'); */
  background-position: 0 50px;
  background-repeat: no-repeat;
  background-size: 140px 400px;
}

.pe_page_block.block_with_images_woman_small {
  /* background-image: url('../../resources/images_pe/pe_warning_woman_small.png'); */
  background-position: 0 50px;
  background-repeat: no-repeat;
  background-size: 140px 200px;
}

.pe_page_block .with_warning_msg {
  border-bottom: dashed 1px #999;
}

.pe_page_block .with_warning_msg p {
  font-weight: bold;
}

.pe_page_block h1.block_big_title {
  font-style: normal;
  font-weight: normal;
}

.pe_page_block h1.with_green_color {
  color: #0d7149;
}

.pe_page_block .block_with_left_margin {
  display: block;
  margin-left: 140px;
  margin-right: 10px;
}

.pe_page_block h1 span {
  color: #999;
  font-size: 14px;
  font-weight: normal;
  margin-left: 10px;
}

.peTable {
  color: #444;
  font-size: 14px;
  line-height: 150%;
  text-decoration: none;
  border-top: solid 1px #aaa;
  border-left: solid 1px #aaa;
}

.peTableTitle {
  color: #444;
  font-size: 14px;
  line-height: 150%;
  text-decoration: none;
  font-weight: bold;
  padding: 5px;
  border-right: solid 1px #aaa;
  border-bottom: solid 1px #aaa;
  white-space: nowrap;
  background-color: #e7e7e7;
}

.peTableTd {
  color: #444;
  font-size: 14px;
  line-height: 150%;
  text-decoration: none;
  padding: 5px;
  border-right: solid 1px #aaa;
  border-bottom: solid 1px #aaa;
  white-space: nowrap;
}

.guide_content {
  padding-top: 10px;
  width: 100%;
  height: 300px;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
}

.guide_content ol {
  padding-right: 15px;
}

.guide_content li {
  font-size: 14px;
  line-height: 200%;
}

.paragraph_content_list {
  display: block;
  padding: 0;
  margin: 0;
}

.paragraph_content_list ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.paragraph_content_list li {
  display: block;
  line-height: 160%;
}

.paragraph_content_link {
  text-decoration: none;
  color: #15629f;
  margin-left: 20px;
}

.paragraph_content_link:hover {
  color: #666;
}

@media only screen and (max-width: 500px) {
  .pe_page_block {
    font-size: 0.9rem;
  }

  .pe_page_block.block_with_images_woman {
    background-position: 0 20px;
    background-repeat: no-repeat;
    background-size: 98px 280px;
  }

  .pe_page_block .block_with_left_margin {
    margin-left: 100px;
  }

  .pe_box_warning .images {
    font-size: 0.9rem;
  }

  .pe_page_block ol {
    font-size: 0.9rem;
  }

  .pe_page_block li {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  .pe_page_block h1 {
    font-size: 1.2rem;
  }

  .pe_page_block h1 span {
    font-size: 0.9rem;
  }

  .guide_content li {
    font-size: 0.9rem;
    line-height: 200%;
  }

  .pe_box_img {
    width: 100px;
    min-height: 140px;
  }

  .pe_box_img img {
    width: 100px;
    height: 100px;
  }

  .pe_box_img .content {
    font-size: 0.9rem;
  }

  .pe_box_warning .content {
    width: 95%;
  }

  .pe_box_warning .images {
    width: 80%;
  }

  .pe_box {
    width: 100%;
    margin-bottom: 10px;
  }

  .pe_box .image {
    width: 33%;
  }

  .pe_box .image img {
    width: 100%;
  }

  .pe_box .text {
    width: 67%;
  }

  .pe_box .title h3 {
    font-size: 0.9rem;
  }

  .pe_box .content {
    font-size: 0.9rem;
    line-height: 160%;
    text-indent: 0;
    margin-right: 0;
  }

  .pe_page_block a {
    font-size: 0.9rem !important;
  }

  .peTable,
  .peTableTitle,
  .peTableTd {
    font-size: 0.9rem;
  }
}
</style>
